#include "StdAfx.h"
#include "DD_LineCap.h"

#include "xhLineCap.h"

DD_LineCap::DD_LineCap()
{
	m_pxhLineCap = NULL;
}

DD_LineCap::~DD_LineCap()
{
	MySafeDelete(m_pxhLineCap);
}

#define DKQ_SECT {if( NULL== m_pxhLineCap ) return -1;}

int DD_LineCap::Initialize()
{
	if( NULL == m_pxhLineCap )
	{
		m_pxhLineCap = new xhLineCap;
	}

	DKQ_SECT
	return m_pxhLineCap->Initialize();
}

int DD_LineCap::UnInitialize()
{
	DKQ_SECT
	return m_pxhLineCap->UnInitialize();
}


int DD_LineCap::GetCaptureList(zkCapDevDesc **ppDescs,int &nCount)
{
	DKQ_SECT
	return m_pxhLineCap->GetCaptureList(ppDescs,nCount);
}

int DD_LineCap::SelectCapture(zkCapDevDesc *pDesc)
{
	DKQ_SECT
	return m_pxhLineCap->SelectCapture(pDesc);
}

int DD_LineCap::RegOnDrawCallBack(OnDrawCallBackFun funCallBack,void *pContext)
{
	DKQ_SECT
	return m_pxhLineCap->RegOnDrawCallBack(funCallBack,pContext);
}

int DD_LineCap::SetHwnd(HWND hWnd)
{
	DKQ_SECT
	return m_pxhLineCap->SetHwnd(hWnd);
}

int DD_LineCap::UnLock()
{
	DKQ_SECT
	return m_pxhLineCap->UnLock();
}

int DD_LineCap::OpCaptureParam(void *pVoid)
{
	DKQ_SECT
	return m_pxhLineCap->OpCaptureParam(pVoid);
}


int DD_LineCap::GetLineSize(int &nWidth,int &nHeight)
{
	DKQ_SECT
	return m_pxhLineCap->GetLineSize(nWidth,nHeight);
}

int DD_LineCap::GetLineInfo(zkImgBitInfo **ppImgBitInfo)
{
	DKQ_SECT
	return m_pxhLineCap->GetLineInfo(ppImgBitInfo);
}

int DD_LineCap::GetLineData(zkImgBitInfo **ppImgBitInfo)
{
	DKQ_SECT
	return m_pxhLineCap->GetLineData(ppImgBitInfo);
}

int DD_LineCap::StartCapture()
{
	DKQ_SECT
	return m_pxhLineCap->StartCapture();
}

int DD_LineCap::StopCapture()
{
	DKQ_SECT
	return m_pxhLineCap->StopCapture();
}

int	DD_LineCap::Draw(void *pVoid)
{
	DKQ_SECT
	return m_pxhLineCap->Draw(pVoid);
}

int DD_LineCap::GetLiveHistogramInfo(void **ppHistogram)
{
	DKQ_SECT
	return m_pxhLineCap->GetLiveHistogramInfo(ppHistogram);
}

int DD_LineCap::GetGrayValue(int x,int y,DWORD &dwGray)
{
	DKQ_SECT
	return m_pxhLineCap->GetGrayValue(x,y,dwGray);
}

int DD_LineCap::SelectBadPixelFile(char *pFileName)
{
	DKQ_SECT
	return m_pxhLineCap->SelectBadPixelFile(pFileName);
}

int DD_LineCap::SelectReviseFile(char *pFileName,int nCreateRevise)
{
	DKQ_SECT
	return m_pxhLineCap->SelectReviseFile(pFileName,nCreateRevise);
}

int DD_LineCap::CreateRevise(void *pVoid)
{
	DKQ_SECT
	return m_pxhLineCap->CreateRevise(pVoid);
}

int DD_LineCap::SetReviseGrade(int nGrade)
{
	DKQ_SECT
	return m_pxhLineCap->SetReviseGrade(nGrade);
}

int DD_LineCap::SaveReviseFile(char *pFileName)
{
	DKQ_SECT
	return m_pxhLineCap->SaveReviseFile(pFileName);
}

int DD_LineCap::CreateBadPixelRevise(void *pVoid)
{
	DKQ_SECT
	return m_pxhLineCap->CreateBadPixelRevise(pVoid);
}

int DD_LineCap::SetBadPixelReviseGrade(int nGrade)
{
	DKQ_SECT
	return m_pxhLineCap->SetBadPixelReviseGrade(nGrade);
}

int DD_LineCap::SaveBadPixelReviseFile(char *pFileName)
{
	DKQ_SECT
	return m_pxhLineCap->SaveBadPixelReviseFile(pFileName);
}

int DD_LineCap::GetBadPixelValue(int x,int y,DWORD &dwValue)
{
	DKQ_SECT
	return m_pxhLineCap->GetBadPixelValue(x,y,dwValue);
}

int DD_LineCap::SetBadPixelValue(int x,int y,DWORD dwValue)
{
	DKQ_SECT
	return m_pxhLineCap->SetBadPixelValue(x,y,dwValue);
}


int DD_LineCap::SetRecordParam(void *pVoid )
{
	DKQ_SECT
	return m_pxhLineCap->SetRecordParam(pVoid);
}
int DD_LineCap::StartRecord(char *pFileName)
{
	DKQ_SECT
	return m_pxhLineCap->StartRecord( pFileName );
}
int DD_LineCap::StopRecord()
{
	DKQ_SECT
	return m_pxhLineCap->StopRecord();
}